import time
import os
import multiprocessing as mp


def work():
    pid = os.getpid()
    for i in range(2):
        print(pid, i)
        time.sleep(0.5)


if __name__ == '__main__':
    print('pid:', os.getpid())
    p1 = mp.Process(target=work)
    p1.start()
    time.sleep(10)
    print('join...')
    p1.join()
    time.sleep(10)
